﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using UIT.Controls;
using UIT.Markup;
using UIT.Web.Renderers.Specials;

namespace UIT.Web.Renderers
{
	public class ButtonRenderer : WebControlRenderer<Button>
	{
		#region IRenderer<Button> Members

		public override void Render(Button control)
		{
			writer.WriteStartElement("input");
			if (control.IsDefault)
				writer.WriteAttributeString("type", "submit");
			else
				writer.WriteAttributeString("type", "button");
			if (control.Id != null)
			{
				writer.WriteAttributeString("id", control.Id);
				writer.WriteAttributeString("name", control.Id);
				writer.WriteAttributeString("class", "postbacker");
			}
			control.RenderAcls(writer);

			Render(control, "Text", "value");

            control.RenderVisualStates(writer);

			writer.WriteEndElement();
		}

		#endregion
	}
}
